{template "nheader.html"}

<script src="{THEME_PATH}admin/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js" type="text/javascript"></script>
<div class="row">
    <div class="col-md-12">

            <div class="col-md-12">
                <div class="fileinput fileinput-new mytx" data-provides="fileinput">
                    <div class="fileinput-preview thumbnail" id="mytx">
                        <img  src="{dr_avatar($member.uid, 0)}">
                    </div>
                    <div>
                        <div class="btn red btn-outline btn-file">
                            <span class="fileinput-new"> 上传 </span>
                            <span class="fileinput-exists"> 上传 </span>
                            <input type="file" name="...">
                        </div>
                        <a href="javascript:;" class="btn red fileinput-exists" data-dismiss="fileinput"> <i class="fa fa-trash-o"></i>  删除 </a>
                        <a href="javascript:dr_save();" class="btn green fileinput-exists"> <i class="fa fa-save"></i> 保存 </a>
                    </div>
                </div>
            </div>
        <script type="text/javascript">
            function dr_save() {
                dr_tips('正在上传...', 3, 2);
                var tx = $('#mytx img').attr('src');
                $.post("{dr_member_url('account/upload', array('iajax' => 1))}", {tx: tx}, function(data) {
                    if(data == 1) {
                        dr_tips('上传成功', 3, 1);
                        window.location.reload();
                    } else {
                        dr_tips('上传失败：'+data);
                    }
                });
            }
        </script>
    </div>
</div>

{template "nfooter.html"}